<template>
  <div class="page-wrap">
    <!-- 页面面包屑 -->
    <bread :cur-path="{ toPath: '/honor', name: '企业荣誉' }" />
    <div class="page-main">
      <div class="con-box">
        <div class="main-menu-box">
          <h2><i class="yicon"></i>关于我们</h2>
          <ul class="main-menu shadow-box">
            <nuxt-link to="/about" tag="li"><a>公司简介</a></nuxt-link>
            <nuxt-link to="/honor" tag="li"><a>企业荣誉</a></nuxt-link>
          </ul>
        </div>
        <div class="main shadow-box">
            <h1><span>企业荣誉</span></h1>
            <div class="main-content">
                <p class="info" v-html="htmlContent">
                </p>
            </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Bread from '@/components/layout/Bread'
import api from '@/api'
import { htmlDecodeByRegExp } from '@/assets/js/utils'

export default {
  components: {
    Bread
  },
  async asyncData (context) {
    try {
      const resData = await api.honor()
      if (resData.data.errorCode === 0) {
        const content = htmlDecodeByRegExp(resData.data.data.content)
        return {
          htmlContent: content
        }
      }
    } catch (error) {
      console.log(error)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
